#ifndef HGT_3D_SCENE_PANEL_H
#define HGT_3D_SCENE_PANEL_H 1

#include <QTimer>
#include <osgQt/GraphicsWindowQt>
#include <FreeEarth/IRenderContext.h>

class C3DScenePanel : public osgQt::GLWidget
{
	Q_OBJECT;
public:
	C3DScenePanel();

	///初始化，其中为渲染的视口设置了图形上下文
	bool Initialize(IRenderContext *pRenderContext);

	bool UnInitialize();

Q_SIGNALS:
	void SignalDropEvent(QObject *pWidget, osg::Vec3d llh);

protected:
	void InstallFrameTimer();

public: //osgQt::GLWidget
	virtual void paintEvent( QPaintEvent* );
	virtual void resizeEvent( QResizeEvent* event );
	virtual void dragEnterEvent(QDragEnterEvent* event);
	virtual void dragMoveEvent(QDragMoveEvent* event);
	virtual void dropEvent(QDropEvent* event);

	virtual bool event( QEvent* event );

private:
	QTimer m_timer;

	osg::observer_ptr<IRenderContext>    m_opRenderContext;
};

#endif // HGT_3D_SCENE_PANEL_H
